package flextv.main.event {

import com.adobe.cairngorm.control.CairngormEvent;

import flextv.core.vo.StoredItem;

public class StoredItemDownloadedEvent extends CairngormEvent {
	
	public static const STORED_ITEM_DOWNLOADED: String = "storedItemDownloaded";
	
	private var _storedItem: StoredItem;
	
	public function StoredItemDownloadedEvent(storedItem: StoredItem) {
		super(STORED_ITEM_DOWNLOADED);
		
		if(storedItem == null) throw new ArgumentError("storedItem == null");
		if(storedItem.downloaded != 100) throw new ArgumentError("storedItem.downloaded != 100 but [" + storedItem.downloaded + "]");
		 
		_storedItem = storedItem;
	}
	
	public function get storedItem(): StoredItem {
		return _storedItem;
	}
	
	public override function toString(): String {
		return "StoredItemDownloadedEvent[storedItem="+_storedItem+"]";
	}
	
}
}